const {
  Msg,
} = require("./consts");

//石油出售消息广播
exports.oilConfirmExchange = function(nickname, oilNum, money){
  let connectorServers = this.app.getServersByType('connector');
  for(let i = 0; i < connectorServers.length; i++){
    //广播消息
    this.app.get('channelService').broadcast("connector", "oil_confirm_exchange_essence", {nickname, oilNum, money, type: "essence"}, {}, function(err){
      if(err){
        throw new Error(Msg.OIL_CONFIRM_BROAD_ERR);
      }
    });
  }
}
